﻿using System.Collections.Generic;

namespace TrinityCreator.Data
{
    public class ItemInventoryType : IKeyValue
    {
        public ItemInventoryType(int id, string description, int sheath = 0)
            : base(id, description) {
            Sheath = sheath;
        }

        public int Sheath { get; set; }

        internal static ItemInventoryType[] GetAllInventoryTypes()
        {
            var result = new List<ItemInventoryType>();
            result.AddRange(GetNonEquipable());
            result.AddRange(GetArmor());
            result.AddRange(GetOneHandWeapon());
            result.AddRange(GetShield());
            result.AddRange(GetRangedWandGun());
            result.AddRange(GetRangedBow());
            result.AddRange(GetTwoHandWeapon());
            result.AddRange(GetBag());
            result.AddRange(GetThrown());
            result.AddRange(GetAmmo());
            return result.ToArray();
        }

        public static ItemInventoryType[] GetNonEquipable()
        {
            return new[]
            {
                new ItemInventoryType(0, "无法装备")
            };
        }

        public static ItemInventoryType[] GetOneHandWeapon()
        {
            return new[]
            {
                new ItemInventoryType(13, "单手", 3),
                new ItemInventoryType(21, "主手", 3),
                new ItemInventoryType(22, "副手", 6),
                new ItemInventoryType(23, "副手(书)", 6)
            };
        }

        public static ItemInventoryType[] GetShield()
        {
            return new[]
            {
                new ItemInventoryType(14, "副手", 4)
            };
        }

        public static ItemInventoryType[] GetRangedWandGun()
        {
            return new[]
            {
                new ItemInventoryType(26, "远程")
            };
        }

        public static ItemInventoryType[] GetRangedBow()
        {
            return new[]
            {
                new ItemInventoryType(15, "远程(弓)")
            };
        }


        public static ItemInventoryType[] GetTwoHandWeapon()
        {
            return new[]
            {
                new ItemInventoryType(17, "双手", 1)
            };
        }

        public static ItemInventoryType[] GetBag()
        {
            return new[]
            {
                new ItemInventoryType(18, "背包")
            };
        }

        public static ItemInventoryType[] GetThrown()
        {
            return new[]
            {
                new ItemInventoryType(25, "投掷物")
            };
        }

        public static ItemInventoryType[] GetAmmo()
        {
            return new[]
            {
                new ItemInventoryType(24, "弹药")
            };
        }

        public static ItemInventoryType[] GetArmor()
        {
            return new[]
            {
                new ItemInventoryType(1, "头部"),
                new ItemInventoryType(2, "颈部"),
                new ItemInventoryType(3, "肩部"),
                new ItemInventoryType(4, "衬衣"),
                new ItemInventoryType(5, "胸部"),
                new ItemInventoryType(6, "腰部"),
                new ItemInventoryType(7, "腿部"),
                new ItemInventoryType(8, "脚"),
                new ItemInventoryType(9, "手腕"),
                new ItemInventoryType(10, "手"),
                new ItemInventoryType(11, "手指"),
                new ItemInventoryType(12, "饰品"),
                new ItemInventoryType(16, "背部")
            };
        }
        
        public static ItemInventoryType[] GetRelic()
        {
            return new[]
            {
                new ItemInventoryType(28, "Relic")
            };
        }
    }
}